using System;

namespace Blog.Net
{
	/// <summary>
	/// Summary description for Util.
	/// </summary>
	public class Util
	{
		private Util(){}
		
		public static bool CheckIsValidDate(int day, int month, int year)
		{
			if(month > 12 || month < 1)
				return false;
			if(day > 31 || day < 1)
				return false;
			if(day > DateTime.DaysInMonth(year, month))
				return false;
			return true;
		}
		public static bool CheckIsLastDayOfMonth(int day, int month, int year)
		{
			if(DateTime.DaysInMonth(year, month) == day)
				return true;
			else
				return false;
		}
		public static bool CheckIsLastDayOfYear(int day, int month)
		{
			if(day == 31 && month == 12)
				return true;
			else
				return false;
		}
		public static string GetMonthForInt(int monthInt)
		{
			string monthName = "";
			switch(monthInt)
			{
				case 1:
					monthName =  "January";
					break;
				case 2:
					monthName =  "February";
					break;
				case 3:
					monthName =  "March";
					break;
				case 4:
					monthName =  "April";
					break;
				case 5:
					monthName =  "May";
					break;
				case 6:
					monthName =  "June";
					break;
				case 7:
					monthName =  "July";
					break;
				case 8:
					monthName =  "August";
					break;
				case 9:
					monthName =  "September";
					break;
				case 10:
					monthName =  "October";
					break;
				case 11:
					monthName =  "November";
					break;
				case 12:
					monthName =  "December";
					break;
			}
			return monthName;
		}
	}
}
